var categoryInitObj = {
	getCategorySiteAreas : function(){
		var params = 'handler=getCategorySiteAreas&renderType=json';
		var ajaxResults = new Ajax.Request('ajaxDirector.php', {
			method: 'POST',
			parameters: params,
			onSuccess: function(transport) {
				categoryViewObj.renderCategorySiteAreas(transport.responseText);
			}
		});
	},	
}	

var categoryViewObj = {
	renderCategorySiteAreas : function(stringJSON) {
		var jsonObject = stringJSON.evalJSON();
		var totalItems = (jsonObject.CategorySiteAreas.length)-1;
		var catRenderString = '';	
		
		for (i = 0; i <= totalItems; i++) {
			var siteArea = jsonObject.CategorySiteAreas[i].SiteArea;
			
			catRenderString += '<div class="emphBox"><div class="emphBoxInner">';
			catRenderString += '<div id="transCatTitle" style="float: left; cursor: pointer;" onClick="categoryViewObj.toggleCategories('+i+'); return false;">'+siteArea+'</div>';
			catRenderString += '<div style="float: right;" class="addNewCategory">';
			catRenderString += '<a href="#" class="coolButton buttonBGGreen" onClick="categoryUpdateObj.openCategoryForm('+i+'); return false;"><span class="add">Add Item</span></a>';
			catRenderString += '</div><div style="clear: both;"></div>';
			catRenderString += '</div></div>';
			
			}	
		
		$('categoryContainer').innerHTML = catRenderString;
	}
}	

var viewTabContent = {
	content0Load : function() {
		
	}
}

Ext.onReady(function() {
	categoryInitObj.getCategorySiteAreas();
});